<?php 
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: _uploader.phtml 4657 2010-08-15 18:12:37Z huuphuoc $
 * @since		2.0.0
 */
?>
<?php
$this->headLink()->appendStylesheet($this->APP_STATIC_SERVER . '/js/jquery.upload/fileuploader.css');

$this->headScript()
	->appendFile($this->APP_STATIC_SERVER . '/js/jquery.upload/file_uploader_'.$this->lang.'.js');
?>

<div id="<?php echo $this->uploadElementId;?>">       
    <noscript>          
        <p>Bạn phải bật chức năng javascript để thực hiện chức năng upload.</p>
    </noscript>         
</div>
<script language="javascript">
	$(document).ready(function(){
		var uploader = new qq.FileUploader({
		    element: document.getElementById('<?php echo $this->uploadElementId;?>'),
		    action: '<?php echo $this->url($this->arrRouteUpload,"core_media_upload");?>',
		    allowedExtensions: <?php echo $this->options["extension"]?>,
		    sizeLimit		 : <?php echo $this->options["sizeLimit"]?>,
			onComplete		 : <?php echo $this->handlers["onComplete"]?>
		});		
	});
</script>